package com.movie.app.controller;

import com.movie.app.model.Admin;
import com.movie.app.model.ResponseCode;

class AdminFilter {
    public ResponseCode addValid(Admin admin){
        String name = admin.getName();
        String password = admin.getPassword();
        Object params[] = {name, password};

        ResponseCode rc = new ResponseCode();

        for (Object obj : params) {
            if (obj==null){
                rc.setCode(0);
                rc.setContent("缺少參數");
                return rc;
            }
        }
        
        rc.setCode(1);
        rc.setContent("");
        return rc;
    }
}